package com.nineclock.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nineclock.system.pojo.SysCompanyUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface SysCompanyUserMapper extends BaseMapper<SysCompanyUser> {
    @Select("SELECT c.* FROM sys_company_user c\n" +
            "INNER JOIN\n" +
            "sys_company_user_role v\n" +
            "ON\n" +
            "c.id = v.company_user_id\n" +
            "INNER JOIN\n" +
            "sys_role b\n" +
            "ON\n" +
            "v.role_id = b.id\n" +
            "WHERE\n" +
            "c.company_id = 3\n" +
            "AND\n" +
            "b.role_name = 'ROLE_ADMIN_SYS';")
    SysCompanyUser getCurrentAdminByCompanyId(Long companyId);

}
